home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 22 / 4 / DISK2247.ZIP / CBASE101.ZIP / BLKIO112.ZIP / BPUTB.C < prev    next >
Text File  |  1990-06-20  |  1KB  |  54 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "@(#)bputb.c    1.4 - 90/06/20" */
  5.  
  6. /* ansi headers */
  7. /*#include <stddef.h>*/
  8.  
  9. /* local headers */
  10. #include "blkio_.h"
  11.  
  12. /*man---------------------------------------------------------------------------
  13. NAME
  14.      bputb - put a block into a block file
  15.  
  16. SYNOPSIS
  17.      #include <blkio.h>
  18.  
  19.      int bputb(bp, bn, buf)
  20.      BLKFILE *bp;
  21.      bpos_t bn;
  22.      const void *buf;
  23.  
  24. DESCRIPTION
  25.      The bputb function writes the block pointed to by buf into block
  26.      number bn of the block file associated with BLKFILE pointer bp.
  27.      buf must point to a storage area at least as large as the block
  28.      size for bp.
  29.  
  30.      bputb will fail if one or more of the following is true:
  31.  
  32.      [EINVAL]       bp is not a valid BLKFILE pointer.
  33.      [EINVAL]       bn is less than 1.
  34.      [EINVAL]       buf is the NULL pointer.
  35.      [BEEOF]        There are fewer than bn - 1 blocks in
  36.                     the file.
  37.      [BENOPEN]      bp is not open for writing.
  38.  
  39. SEE ALSO
  40.      bgetb, bputbf, bputh.
  41.  
  42. DIAGNOSTICS
  43.      Upon successful completion, a value of 0 is returned.  Otherwise,
  44.      a value of -1 is returned, and errno set to indicate the error.
  45.  
  46. ------------------------------------------------------------------------------*/
  47. int bputb(bp, bn, buf)
  48. BLKFILE *bp;
  49. bpos_t bn;
  50. const void *buf;
  51. {
  52.     return bputbf(bp, bn, (size_t)0, buf, bp->blksize);
  53. }
  54.